package org.fisco.bcos.evidence.gateway.config;

import lombok.Data;

@Data
public class Response {
    public static final int SUCCEED = 1;
    public static final int ERROR = 0;
    public static final int RESOURCELOCKED = 0;//资源占用
    public static final String CREATED = "创建成功";
    public static final String CREATEFAILED = "创建失败";
    public static final String SAVED = "保存成功";
    public static final String SAVEFAILED = "保存失败";
    public static final String NOTEXIST = "输入存在问题，数据不存在";
    public static final String GET = "获取成功";
    public static final String GETFAILED = "获取失败";
    public static final String DELETED = "删除成功";
    public static final String DELETEFAILED = "删除失败";
    public static final String SEARCHED = "搜索成功";
    public static final String SEARCHEFAILED = "搜索失败";


    private int success;
    private String message;
    private Object result;

    public Response(int success, String message, Object obj) {
        this.success = success;
        this.message = message;
        this.result = obj;
    }

    public Response() {
    }

    public void buildResponse(int success, String message, Object obj) {
        this.success = success;
        this.message = message;
        this.result = obj;
    }
}
